﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Zebra.WinFramework
{
    public partial class ChangePasswordForm : FormUC
    {
        CustomErrorProvider myErrorProvider = new CustomErrorProvider();

        public ChangePasswordForm()
        {
            InitializeComponent();
        }

        private bool ValidateBeforeSave()
        {
            bool success = true;
            if (!myErrorProvider.CheckAndShowSummaryErrorMessage()) return false;

            return success;
        }

        private void ChangePasswordForm_Load(object sender, EventArgs e)
        {
            myErrorProvider.Controls.Add((object)txtCurrentPass, "Current Password");
            myErrorProvider.Controls.Add((object)txtNewPassword, "New Password");
            myErrorProvider.Controls.Add((object)txtNewPasswordRetype, "New Password");
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateBeforeSave()) return;
        }
    }
}
